<!DOCTYPE html>
<html>
<head>
	<title></title>
	<script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
	<a id="paybtn" href="javascript:callPay()" class="gpay">点击按钮</a>
</body>
<script type="text/javascript">
	$(function(){
		document.getElementById("paybtn").click();
	});

	var goPay=document.getElementsByTagName('a')[0];
	goPay.onclick = function(){
		if(this.className.indexOf("dis")>-1){
			return false;
		}
	}

	function callPay(){
		alert('callPay');
	}
</script>
</html>